<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tld/FCKeditor" prefix="FCK" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>添加研究报告</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<style type="text/css">
.vb_wid {width:100%; margin: 0 auto; border-top:1px #FDB18D solid; background:#F5F5F5; color:#FE6500; text-indent:20px; line-height:25px; font-size:12px;}
.fb_search {width:90%; margin:0 auto; margin-top:20px; border:1px #FFCD7F solid;}
.fb_search h1 {background:#FFEFBB; margin:0px; padding:0px; line-height:28px; text-indent:10px; font-size:14px;}
.fb_ddd {width:90%; margin:0 auto; margin-top:10px; border-top:3px #FFCC00 solid; background:url(images/pen.gif) no-repeat 5px 3px; height:40px; text-indent:50px; line-height:40px; color:#464646; font-size:12px;}
.fb_nr {width:90%; margin:0 auto; margin-top:10px; line-height:40px; font-size:12px; color:#464646}
.fb_nr span {color:#CCC;}
.fb_nr select {color:464646; font-size:12px;}
.fb_nr Div {margin-left:10px;}
.fb_nr .table11 {border-top:1px #FFCC66 solid; background:#FFF2D7;}
.fb_nr .table22 {border-top:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
.fb_nr .table33 {border-top:1px #FFCC66 solid; border-bottom:1px #FFCC66 solid; background:#FFF2D7;}
.fb_nr .table44 {border-top:1px #E1E1E1 solid; border-bottom:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
.inputtttt {border:1px #DEA303 solid; height:20px; color:#464646; font-size:12px; background:url(images/bottom_bg.jpg) repeat-x left top;}
</style>

<script type='text/javascript' src='/dwr/interface/homeSiteDWRServ.js'></script>
<script type='text/javascript' src='/dwr/engine.js'></script>
<script type='text/javascript' src='/dwr/util.js'></script>

<script type="text/javascript">
 function check(){
 
  var fileTitle = document.getElementById('fileTitle').value;
  var bmFileTypeId = document.getElementById('bmFileTypeId').value;
  var bmResearchInstitutionId = document.getElementById('bmResearchInstitutionId').value;
  var bmResearchReportTypeId = document.getElementById('bmResearchReportTypeId').value;
  var cmQuotedCompanyId = document.getElementById('cmQuotedCompanyId').value;
  var stockName = document.getElementById('stockName').value;
  var fileDescription = document.getElementById('fileDescription').value;
  var attention = document.getElementById('attention').value;
  var createReportDateStr = document.getElementById('createReportDateStr').value;
  
  if(fileTitle == null  || fileTitle==''){
      alert('研究报告标题不可以为空！！！');
      return false;
  }
  
  if(bmFileTypeId == null  || bmFileTypeId==''){
      alert('请选择文件类型！！！');
      return false;
  }
  
  if(bmResearchInstitutionId == null  || bmResearchInstitutionId==''){
      alert('请选择研究机构！！！');
      return false;
  }
  
  if(bmResearchReportTypeId == null  || bmResearchReportTypeId==''){
      alert('请选择报告类型！！！');
      return false;
  }
  
  if(cmQuotedCompanyId == null  || cmQuotedCompanyId==''){
      alert('请输入上市公司股票代号！！！');
      return false;
  }
  
  if(stockName == null  || stockName==''){
      alert('请输入受影响的股票名称！！！');
      return false;
  }
  
  if(fileDescription == null  || fileDescription==''){
      alert('请输入报告的描述！！！');
      return false;
  }
  
  if(attention == null  || attention==''){
      alert('请输入关注的行业！！！');
      return false;
  }
  
  if(createReportDateStr == null  || createReportDateStr==''){
      alert('请输入研究报告的发布时间！！！');
      return false;
  }
  
  var formFile=document.getElementById('formFile').value;
  if(formFile==null||formFile==""){
  	alert('请上传研究报告！！！');
  	return false;
  }
  
  
     
     
  return true;
 }
</script>

     <script type="text/javascript">
       //通过上市公司股票代码获取股票的中文名
       function stockCheckButton(){
          var cmQuotedCompanyId = document.getElementById("cmQuotedCompanyId").value;
          if(cmQuotedCompanyId!=null  && cmQuotedCompanyId!=''){
             
             getStockNameByStockNumId(cmQuotedCompanyId);
          }
       }
       
        var stockNumId;
		function getStockNameByStockNumId(stockNumId){
             //通过类型id和父类id获取Map列表
			 homeSiteDWRServ.loadCmQuotedCompanyByStockNumId(stockNumId,getStockName);
		}
	 
	    function getStockName(data){
	  	  var cmQuotedCompanyName = document.getElementById("cmQuotedCompanyName");
	  	  //显示股票中文名称
	  	  cmQuotedCompanyName.style.display='block';
	      if(data!=null){
	         cmQuotedCompanyName.value=data.stockName;
	      }
	    }
    </script>

</head>


<body>
<logic:present name="add">
<bean:write name="add" filter="false"/>
</logic:present>
<div class="fb_ddd">添加研究报告</div>
<div class="fb_nr">
    <html:form action="/admin/homeSiteResearchReportFileUpload.do?action=add" onsubmit="return check();" enctype="multipart/form-data">
     <table width="100%" border="0">
     <tr>
      <td width="17%" align="center" class="table11">研究报告标题:</td>
      <td width="83%" class="table22"><div><label>
        <input type="text" name="fileTitle" id="fileTitle"  size="50px" /><font color="red">*</font>
     </label></div></td>
	</tr>
	 <tr>
      <td align="center" class="table11">文件类型:</td>
      <td class="table22"><div><label>
           <html:select  property="bmFileTypeId">
             <html:option value="" >请选择</html:option>
              <c:if test="${bmFileTypeList!=null}">
              <html:optionsCollection name="bmFileTypeList" label="fileTypeName" value="id"/>
              </c:if>
           </html:select><font color="red">*</font>
         </label></div></td>
       </tr>
	 <tr>
      <td align="center" class="table11">研究机构:</td>
      <td class="table22"><div><label>
           <html:select property="bmResearchInstitutionId">
              <html:option value="" >请选择</html:option>
              <c:if test="${bmResearchInstitutionList!=null}">
              <html:optionsCollection name="bmResearchInstitutionList" label="institutionName" value="id"/>
              </c:if>
           </html:select><font color="red">*</font>
        </label></div></td>
       </tr>
       

	 <tr>
      <td align="center" class="table11">研究报告类型:</td>
      <td class="table22"><div><label>
           <html:select property="bmResearchReportTypeId">
              <html:option value="" >请选择</html:option>
              <c:if test="${bmResearchReportTypeList!=null}">
              <html:optionsCollection name="bmResearchReportTypeList" label="reportTypeName" value="id"/>
              </c:if>
           </html:select><font color="red">*</font>
         </label></div></td>
     </tr>
     
      <tr>
	      <td align="center" class="table33">主要受影响的股票:</td>
	      <td class="table44"><div><label>
	          <input type="text" id="cmQuotedCompanyId" name="cmQuotedCompanyId" /><input type="button" onclick="stockCheckButton();" value="查询"/>
	          <input type="text" id="cmQuotedCompanyName" name="cmQuotedCompanyName"  readonly="readonly" style="display:none;"/>
	          <font color="red">*</font><span>(比如:600162)</span>
	          </label></div>
	       </td>
      </tr>
     
	 <tr>
      <td align="center" class="table33">受影响的股票:</td>
      <td class="table44"><div><label>
          <textarea rows="5" cols="60" id="stockName" name="stockName"></textarea><font color="red">*</font><span>(比如:博瑞传播(600880‎),香江控股(600162))</span>
          </label></div></td>
       </tr>
       <tr>
      <td align="center" class="table33">文件简要描述:</td>
      <td class="table44"><div><label>
         <textarea rows="5" cols="60"  id="fileDescription" name="fileDescription"></textarea><font color="red">*</font><span>(对文件简要描述)</span>
         	</label></div></td>
       </tr>
       <tr>
       <td align="center" class="table33">关注点：</td>
      <td class="table44"><div><label>
          <textarea rows="5" cols="60"  id="attention" name="attention"></textarea><font color="red">*</font><span>(关注行业,比如:房地产,银行,矿产)</span>
         </label></div></td>
       </tr>
       <tr>
      <td align="center" class="table11">报告发布时间:</td>
      <td class="table22"><div><label>
          <input name="createReportDateStr" type="text" id="createReportDateStr" /><font color="red">*</font><span>报告发布时间,比如:2009-01-01</span>
          </label></div></td>
       </tr>
       
        <tr>
      <td align="center" class="table11">上传文件:</td>
      <td class="table22"><div><label>
           <input type="file" name="formFile" /><span>报告发布时间,比如:2009-01-01</span>
          </label></div></td>
       </tr>
      
	 
	   <tr>
         <td></td>
         <td>
         <label>
           <input type="submit" name="Submit" value="提交" class="cpxx_int1" />
         </label>
         </td>
       </tr>
       
       
     </table>
    </html:form>
   <h1><img src="image/qqddc_shop1.gif" width="720" height="8" /></h1>
</div>
</body>
</html:html>
